#ifndef _MATERIAL_H
#define _MATERIAL_H

#include <fstream>
#include <string>
#include <math.h>
#include <GL/glew.h>
#include "Export.h"
#include "Color4.h"

namespace glow
{
  class SHARED Material
  {

  private:
    /*********{Reflective properties of the object affected by light}******/

    //Ambient illumination is light that's been scattered so much by the environment that its direction is impossible to determine - it seems to come from all directions. Backlighting in a room has a large ambient component, since most of the light that reaches your eye has first bounced off many surfaces. A spotlight outdoors has a tiny ambient component; most of the light travels in the same direction, and since you're outdoors, very little of the light reaches your eye after bouncing off other objects. When ambient light strikes a surface, it's scattered equally in all directions. 
    GLfloat Material_Ambient[4];

    //The diffuse component is the light that comes from one direction, so it's brighter if it comes squarely down on a surface than if it barely glances off the surface. Once it hits a surface, however, it's scattered equally in all directions, so it appears equally bright, no matter where the eye is located. Any light coming from a particular position or direction probably has a diffuse component. 
    GLfloat Material_Diffuse[4];

    //specular light comes from a particular direction, and it tends to bounce off the surface in a preferred direction. A well-collimated laser beam bouncing off a high-quality mirror produces almost 100 percent specular reflection. Shiny metal or plastic has a high specular component, and chalk or carpet has almost none. You can think of specularity as shininess.
    GLfloat Material_Specular[4];

    //Shininess of the object
    float _shininess;

  public :
  
    Material();
    
    void activate() const;

    void setAmbient(const Color4f &color);
    void setDiffuse(const Color4f &color);
    void setSpecular(const Color4f &color);
    void setShininess(float shininess);
  
    void getAllMat() const;
  };
}

#endif
